ARM platforms: Define exception macros
authorJeenu Viswambharan <[email protected]>
Tue, 24 Oct 2017 10:47:13 +0000 (11:47 +0100)
committerJeenu Viswambharan <[email protected]>
Mon, 13 Nov 2017 08:38:51 +0000 (08:38 +0000)
Define number of priority bits, and allocate priority levels for SDEI.

Change-Id: Ib6bb6c5c09397f7caef950c4caed5a737b3d4112
Signed-off-by: Jeenu Viswambharan <[email protected]>
include/plat/arm/common/arm_def.h
plat/arm/common/aarch64/arm_ehf.c [new file with mode: 0644]
plat/arm/common/arm_common.mk

index 9e82e2982116ec1a3ce2b6290a00698678b77844..5177b06ece5b96f6f4d5610ee535cb2b687798ca 100644 (file)
  */
 #define PLAT_PERCPU_BAKERY_LOCK_SIZE           (1 * CACHE_WRITEBACK_GRANULE)
 
+/* Priority levels for ARM platforms */
+#define PLAT_SDEI_CRITICAL_PRI         0x60
+#define PLAT_SDEI_NORMAL_PRI           0x70
+
+/* ARM platforms use 3 upper bits of secure interrupt priority */
+#define ARM_PRI_BITS                   3
 
 #endif /* __ARM_DEF_H__ */
diff --git a/plat/arm/common/aarch64/arm_ehf.c b/plat/arm/common/aarch64/arm_ehf.c
new file mode 100644 (file)
index 0000000..785b7bb
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <ehf.h>
+#include <platform_def.h>
+
+/*
+ * Enumeration of priority levels on ARM platforms.
+ */
+ehf_pri_desc_t arm_exceptions[] = {
+#if SDEI_SUPPORT
+       /* Critical priority SDEI */
+       EHF_PRI_DESC(ARM_PRI_BITS, PLAT_SDEI_CRITICAL_PRI),
+
+       /* Normal priority SDEI */
+       EHF_PRI_DESC(ARM_PRI_BITS, PLAT_SDEI_NORMAL_PRI),
+#endif
+};
+
+/* Plug in ARM exceptions to Exception Handling Framework. */
+EHF_REGISTER_PRIORITIES(arm_exceptions, ARRAY_SIZE(arm_exceptions), ARM_PRI_BITS);
index 44eb43f629ce2d400c42420ab144d1b6e5ff271f..a3cd9d85013ba45dc3e76ff69f9abdc51bed6950 100644 (file)
@@ -184,6 +184,10 @@ BL31_SOURCES               +=      plat/arm/common/arm_sip_svc.c                   \
                                lib/pmf/pmf_smc.c
 endif
 
+ifeq (${EL3_EXCEPTION_HANDLING},1)
+BL31_SOURCES           +=      plat/arm/common/aarch64/arm_ehf.c
+endif
+
 ifneq (${TRUSTED_BOARD_BOOT},0)
 
     # Include common TBB sources